package com.gg.admin.user.contorller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.gg.admin.user.service.AdminUserService;
import com.gg.entity.User;

import helpers.baseservlet.BaseServlet;
@WebServlet("/admin/AdminShowAllUsersServlet")
public class AdminShowAllUsersServlet extends BaseServlet {
	@Autowired 
	private AdminUserService adminUserService;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		List<User> users =adminUserService.ShowAllUsers();
		request.getSession().setAttribute("users",users);
		response.sendRedirect("/fruits/BSindex1.jsp");
		
		
	}


}
